﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PickGold.Util.Proxies
{
	/// <summary>
	/// 指定属性代理器的存储键名
	/// </summary>
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Method, Inherited=true, AllowMultiple=false)]
	public class PropertiesProxyKeyAttribute : Attribute
	{
		private object _Key;

		/// <summary>
		/// 构造一个实例
		/// </summary>
		/// <param name="key">键名</param>
		public PropertiesProxyKeyAttribute(string key) : this(null, key) { }
		/// <summary>
		/// 构造一个实例
		/// </summary>
		/// <param name="key">键名</param>
		public PropertiesProxyKeyAttribute(sbyte key) : this(null, key) { }
		/// <summary>
		/// 构造一个实例
		/// </summary>
		/// <param name="key">键名</param>
		public PropertiesProxyKeyAttribute(byte key) : this(null, key) { }
		/// <summary>
		/// 构造一个实例
		/// </summary>
		/// <param name="key">键名</param>
		public PropertiesProxyKeyAttribute(short key) : this(null, key) { }
		/// <summary>
		/// 构造一个实例
		/// </summary>
		/// <param name="key">键名</param>
		public PropertiesProxyKeyAttribute(int key) : this(null, key) { }
		/// <summary>
		/// 构造一个实例
		/// </summary>
		/// <param name="key">键名</param>
		public PropertiesProxyKeyAttribute(long key) : this(null, key) { }
		/// <summary>
		/// 构造一个实例
		/// </summary>
		/// <param name="key">键名</param>
		public PropertiesProxyKeyAttribute(float key) : this(null, key) { }
		/// <summary>
		/// 构造一个实例
		/// </summary>
		/// <param name="key">键名</param>
		public PropertiesProxyKeyAttribute(double key) : this(null, key) { }
		/// <summary>
		/// 构造一个实例
		/// </summary>
		/// <param name="key">键名</param>
		public PropertiesProxyKeyAttribute(decimal key) : this(null, key) { }
		/// <summary>
		/// 构造一个实例
		/// </summary>
		/// <param name="key">键名</param>
		public PropertiesProxyKeyAttribute(Enum key) : this(null, key) { }
		/// <summary>
		/// 构造一个实例
		/// </summary>
		/// <param name="key">键名</param>
		public PropertiesProxyKeyAttribute(Guid key) : this(null, key) { }
		/// <summary>
		/// 构造一个实例
		/// </summary>
		/// <param name="type">暂时保留</param>
		/// <param name="key">键名</param>
		protected PropertiesProxyKeyAttribute(object type, object key)
		{
			type = key;
			this._Key = type;
		}

		/// <summary>
		/// 键名
		/// </summary>
		public object Key
		{
			get
			{
				return this._Key;
			}
		}
	}
}
